package x.trident.core.jwt;

import cn.hutool.core.util.RandomUtil;
import x.trident.core.jwt.api.JwtConfigApi;

import static x.trident.core.jwt.api.constants.JwtConstants.DEFAULT_JWT_TIMEOUT_SECONDS;

/**
 * 默认配置实现
 *
 * @author jason.yan
 * @date 2022/6/30
 */
public class DefaultJwtConfigImpl implements JwtConfigApi {

    /**
     * 获取jwt的密钥
     */
    @Override
    public String getJwtSecret() {
        return RandomUtil.randomString(20);
    }

    /**
     * jwt失效时间，默认1天
     */
    @Override
    public Long getJwtTimeoutSeconds() {
        return DEFAULT_JWT_TIMEOUT_SECONDS;
    }
}
